#!/usr/bin/env node

const pic_name = process.argv[2];
const log = console.log;
const fs = require('fs');
fs.readFile(pic_name,function(err,buf){
    if(err){
        console.error(err);
        process.exit(1);
    }
    if(buf.toString('ascii',0,2) === 'BM'){
        log('width:',buf.readInt32LE(0x12));
        log('height:',buf.readInt32LE(0x16));
        log('color depth:',buf.readUInt16LE(0x1c));
    }
});
